package com.wxd.controller;


import com.wxd.entity.Class;
import com.wxd.service.ClassService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wxd
 * @since 2022-03-08
 */
@RestController
@RequestMapping("/class")
public class ClassController {
    @Resource private ClassService cs;
    @GetMapping("/selectAllAndTea")
    public List<Class> selectAll(){
        return cs.selectAllClassAndTeacher();
    }
    @PostMapping("/add")
    public void addClass(@RequestBody Class classes){
        cs.save(classes);
    }
}

